﻿using System;
using System.Windows.Forms;

namespace McmWinFormsApplication1
{
    internal static class Program
    {
        /// <summary>
        ///     The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                // Env.Initialize should not be executed here
                // because the SynchronizationContext does not exist yet
                // Instead it will be executed in the main form.OnLoad()
                // (...)

                Application.Run(new Form1());
            }
            finally
            {
                // close all message channels
                // otherwise the program won't stop
                Env.ShutDown();
            }
        }
    }
}